package com.lin.jdk.juc.stream;

import java.util.ArrayList;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.stream.IntStream;

/**
 * 验证 Stream 的 Spliterator 针对的最小大小为：1024
 */
public class StreamSpliterator {

    public static void main(String[] args) {
        ArrayBlockingQueue<Integer> arr = new ArrayBlockingQueue<>(1024);
        IntStream.range(0, 1022).forEach(i -> {
            arr.add(i);
        });

        arr.parallelStream().forEach(i -> {
            System.out.println(Thread.currentThread().getName() + " ==> " + i);
        });
    }


}
